<template>
	<view class="page_scroll_view">
		<tn-navbar fixed :bottom-shadow="false">订单详情</tn-navbar>
		<scroll-view scroll-y="true">
			<VoucherVue v-if="orderType=='voucher'" :orderInfo="orderInfo"></VoucherVue>
			<ComboVue v-if="orderType=='combo'" :orderInfo="orderInfo"></ComboVue>
			<DeliveryVue v-if="orderType=='delivery'" :orderId="orderInfo.id"></DeliveryVue>
			<SpecialVue v-if="orderType=='special'" :orderId="orderInfo.id"></SpecialVue>
		</scroll-view>
	</view>
</template>

<script setup>
	import VoucherVue from './components/Voucher.vue'
	import ComboVue from './components/Combo.vue'
	import DeliveryVue from './components/Delivery.vue'
	import SpecialVue from './components/Special.vue'
	import {
		ref
	} from 'vue';
	import {
		onLoad
	} from "@dcloudio/uni-app"

	onLoad((e) => {
		const {
			item,
			type
		} = JSON.parse(decodeURIComponent(e.obj))
		orderType.value = type
		orderInfo.value = item
	})

	const orderType = ref('')
	const orderInfo = ref(null)
</script>

<style scoped lang="scss">

</style>